import { Switch,Link,Route } from 'react-router-dom'; // react-router-dom 和 react-router 有什么区别
import './App.css';
import Index from './pages/index';



function App() {

  const urls = ['/','/index']
  return (

    <div className="App">
      
      <ul>
        <li><Link to={urls[0]}>根页面</Link></li>
        <li><Link to={urls[1]}>主页</Link></li>
        
      </ul>

      <Switch>

        <Route path={urls[0]} exact render={() => <div>....</div>}/>
        <Route path={urls[1]} exact render={() => <Index/>}/>

      </Switch>
    </div>
  );
}

export default App;
